CREATE TABLE [dbo].[DnnProduct_Profile]
(
[ProfileId] [int] NOT NULL IDENTITY(1, 1),
[UserId] [int] NOT NULL,
[PortalId] [int] NOT NULL,
[ProfileData] [ntext] COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[CreatedDate] [datetime] NOT NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
ALTER TABLE [dbo].[DnnProduct_Profile] ADD CONSTRAINT [PK_DnnProduct_Profile] PRIMARY KEY CLUSTERED  ([ProfileId]) WITH (FILLFACTOR=85) ON [PRIMARY]
GO
CREATE UNIQUE NONCLUSTERED INDEX [IX_DnnProduct_Profile] ON [dbo].[DnnProduct_Profile] ([UserId], [PortalId]) WITH (FILLFACTOR=85) ON [PRIMARY]
GO
ALTER TABLE [dbo].[DnnProduct_Profile] WITH NOCHECK ADD CONSTRAINT [FK_DnnProduct_Profile_DnnProduct_Portals] FOREIGN KEY ([PortalId]) REFERENCES [dbo].[DnnProduct_Portals] ([PortalID]) ON DELETE CASCADE NOT FOR REPLICATION
GO
ALTER TABLE [dbo].[DnnProduct_Profile] WITH NOCHECK ADD CONSTRAINT [FK_DnnProduct_Profile_DnnProduct_Users] FOREIGN KEY ([UserId]) REFERENCES [dbo].[DnnProduct_Users] ([UserID]) ON DELETE CASCADE NOT FOR REPLICATION
GO
